() => {
    //函数的可选参数
    const fn1 = (a: number, b?: string): void => { }

    //函数参数的默认值
    const fn2 = (a: number, b: string = "1"): void => { }

    //剩余参数
    const fn3 = (a: number, b: number, ...arg: string[]) => { }


    //函数重载
    function fn4(a: number, b: number): number;
    function fn4(a: string, b: string): string;
    function fn4(a: number | string, b: number | string): number | string | void {
        if (typeof a === "number" && typeof b === "number") {
            return a + b
        }
        if (typeof a === "string" && typeof b === "string") {
            return a + b
        }
    }
    // fn4(1, "2")
    fn4(1, 2)
    fn4("1", "2")
}